(function(){
	F={A:window,B:screen,C:location,D:document,E:null,F:navigator,G:navigator.userAgent.toString().replace(/\s+/g,''),H:'toLowerCase',I:'indexOf',J:'appendChild',K:'getAttribute',L:document.documentElement,M:'getElementsByTagName'};
	F.A.Q={
		A:{A:'http://ad.yixuanlm.com/mysql.cnad.php'},
		B:{A:'',B:'',C:'',D:0,E:'',F:'',G:0,H:'',M:'',V:''},
		C:{},
		D:function(A,B,C){
			var A=F.D.createElement(A);
			if(typeof C=='function'){A.onload=C;}
			if(typeof B=='object'){
				for(k in B){
					if(typeof B[k]=='string'){
						if(k=='style'){A.style.cssText=B[k];}else{A.setAttribute(k,B[k]);}
					}
				}
			}
			return A;
		},
		E:function(A){var r='';for(k in A){r+=k+'='+encodeURIComponent(A[k])+'&';}r=r.slice(0,-1);return r;},
		F:function(A,B){
			if(typeof B=='object'){A+=this.E(B);}else if(B instanceof Array){for(var i=0;i<B.length;i++){A+=this.E(B[I])}}
			var o=this.D('script',{type:'text/javascript',src:A,charset:'utf-8'});
			var h=F.D[F.M]('head')[0];
			h[F.J](o);
		},
		G:function(A){return F.D.getElementById(A);},
		H:function(A){var O=this.G(A);F.E.removeChild(O);},
		I:function(A,B){
			if(!B){if(!F.D.body){this.I(this.D('body'),F.D);}B=F.E=F.D.body;}
			B[F.J](A);
		},
		J:function(){
			var A=(F.G[F.H])(),B=null,C=(F.F.platform.toString())[F.H](),D={
			'mobile':/mobile([\d.]+)/,'maxthon':/maxthon\D*([\d.]+)/,'theworld':/theworld/,'360':/360/,
			'tencent':/tencent/,'sougou':/se1.x/,'avant':/avant/,'ie':/msie([\d.]+)/,'firefox':/firefox\/([\d.]+)/,
			'opera':/opera.([\d.]+)/,'chrome':/chrome\/([\d.]+)/,'safari':/version\/([\d.]+).*safari/};
			this.B.A=F.C.href;
			if(F.D.referrer.length>0){this.B.B=F.D.referrer;}else{try{if(opener.location.href.length>0){this.B.B=opener.location.href;}}catch(e){}}
			for(k in D){if(B=A.match(D[k])){B[0]=k;break;};}
	        this.B.C=B==null?'none':B[0],this.B.D=B==null?0:parseInt(B[1]);
			this.B.E=(F.F.systemLanguage||F.F.language)[F.H]();
			if(C=='win32'||C=='windows'){
				if(!A){this.B.F=C;}if(A[F.I]('windowsnt5.0')>-1||A[F.I]('windows2000')>-1)this.B.F='w2000';
		        if (A[F.I]('windowsnt5.1')>-1||A[F.I]('windowsxp')>-1){this.B.F='wxp';}
		        if(A[F.I]('windowsnt5.2')>-1||A[F.I]('windows2003')>-1)this.B.F='w2003';
		        if(A[F.I]('windowsnt6.0')>-1||A[F.I]('windowsvista')>-1)this.B.F='wvista';
		        if(A[F.I]('windowsnt6.1')>-1||A[F.I]('windows7')>-1)this.B.F='w7';
			}else if(C=='mac68k'||C=='macppc'||C=='macintosh'||C=='macintel'||C=='ipad'){this.B.F='apple';
			}else if(C=='x11'){this.B.F='unix';}else if(C[F.I]('linux')>-1){this.B.F='linux';}
			this.B.G=screen.width*100000+screen.height;
			this.B.H=this.K();
			this.B.I=F.C.hostname;
		},
		K:function(){
		   var A=(this.B.B?this.B.B:'').replace(/^[^\?]+\??/,'');
		   A+='&'+(this.B.A?this.B.A:'').replace(/^[^\?]+\??/,'');
		   var B=A.split(/[;&]/);
		   var P={};
		   for(var i=0;i<B.length;i++){
		      var K=B[i].split('=');if (!K||K.length!=2){continue;}
		      var key=K[0]; var val=K[1];
		      val=val.replace(/\+/g,' ');P[key]=val;
		   }
		   var SW={Q1:true,NAME:true,KEYWORD:true,KEY:true,BS:true,Q:true,OP:true,QUERY:true,P:true,KWID:true,WD:true,WORD:true,KW:true,W:true};
		   var KW='';
		   for(key in P){if(SW[key.toUpperCase()]){KW=P[key]==''?KW:P[key];}}
		   return KW==''?'':KW;
		},
		L:function(A,B,C,E,J){
			var R=null;
			switch(A){
				case 'image':
					R=this.D('a',{href:C,target:'_blank',style:'border-width:0px;'});
					R[F.J](this.D('img',{src:B,style:'cursor:pointer;border-width:0px;'}));
				break;
				case 'swf':
					R=this.D('div',{style:'width:100%;height:100%;border-width:0px;position:relative;z-index:999;'});
			        if(this.B.C=='ie'){
			            R.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+B+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="wmode" value="transparent"/></object>';
			        }else{
			            R.innerHTML='<embed src="'+B+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="100%" height="100%" name="_adu" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" />';
			        }
					var A=this.D('a',{href:C,target:'_blank',style:'width:100%;height:100%;border-width:0px;display:block;position:absolute;left:0px;top:0px;'});
					R[F.J](A);
				break;
			}
			return R;
		},
		M:function(A,B){
			A=this.G(A);
			if(!B){if(!F.E){F.D.write('<body></body>');}B=F.E;}
			if(A){B.removeChild(A);}
		},
		N:function(){
			return 'Q'+Math.random().toString();
		},
		GO:function(){
			this.J();this.B.T=Math.random();
			this.F(this.A.A+'?',this.B);
		}
	};
	F.A.S={
		A:function(A,B,C,D){
			var func=function(){
				A=A.split('*');
				var sign=Q.N();
				var div=Q.D('div',{id:sign,style:'width:100%;height:auto;position:absolute;left:0px;top:10px;z-index:2147483647;'});
				var center=Q.D('div',{style:'width:'+A[0]+'px;height:'+A[1]+'px;margin:auto;position:relative;'});
				var msg=Q.D('div',{style:'width:153px;height:20px;padding-top:5px;text-align:center;position:absolute;right:0px;z-index:1000;background-color:#555;filter:alpha(opacity=60);opacity:0.6;'});
				var time=Q.D('div',{style:'width:123px;height:20px;float:left;color:#FFF;font-size:12px;font-weight:bold;'});
				var close=Q.D('a',{href:'#',style:'width:30px;height:20px;display:block;float:right;color:#FFF;font-size:12px;font-weight:bold;'});
				close.innerHTML='关闭';
				close.onclick=function(){Q.M(sign);return false;}
				msg[F.J](time);msg[F.J](close);
				center[F.J](msg);
				center[F.J](Q.L(B,C,D));//创建素材
				div[F.J](center);
				Q.I(div);
				var T=10;
				(function(){time.innerHTML="广告剩余时间:"+T+"秒";T>0?(setTimeout(arguments.callee,1000)):(Q.M(sign));T-=1;})();
			};
			if(B=='img'||B=='iframe'){Q.D(B,{src:C},func);}else{func();}
		},
		B:function(A,B,C,D){
			A=A.split('*');
			var sign=Q.N();
			var div=Q.D('div',{id:sign,style:'width:'+A[0]+'px;height:'+A[1]+'px;position:absolute;z-index:2147483647;right:0px;bottom:0px;'});
			var close=Q.D('a',{href:'#',style:'width:30px;height:16px;padding-top:3px;text-align:center;display:block;position:absolute;right:0px;color:#FFF;font-size:12px;font-weight:bold;background-color:#555;filter:alpha(opacity=60);opacity:0.6;'});
			close.innerHTML='关闭';
			close.onclick=function(){Q.M(sign);return false;}
			div[F.J](close);
			div[F.J](Q.L(B,C,D));//创建素材
			Q.I(div);
			(function(){
				if(!div){return false;}
				var W=F.E.scrollTop|F.L.scrollTop|F.A.pageYOffset;
				if(Q.B.C[F.I]('ie')!=-1){
					if(Q.B.D[F.I]('6')!=-1){
						div.style.bottom="-1px";div.style.bottom="0px";
						setTimeout(arguments.callee,300);
						return true;
					}
				}
				div.style.bottom=-W+"px";
				setTimeout(arguments.callee,300);
			})();
		},
		C:function(A,B,C,D){
			var U=new Array();
			var E=function(){
				U[0]=F.A.scrollTop|F.A.pageYOffset;
				U[1]=F.A.scrollLeft|F.A.pageXOffset;
				if(self.innerHeight){
				  U[2]=self.innerWidth;U[3]=self.innerHeight;
				}else if(F.L&&F.L.clientHeight){
				  U[2]=F.L.clientWidth;U[3]=F.L.clientHeight;
				}else if(F.E){
				  U[2]=F.E.clientWidth;U[3]=F.E.clientHeight;
				}
			};E();
			A=A.split('*');A[0]=parseInt(A[0]);A[1]=parseInt(A[1]);
			var sign=Q.N();
			var div=Q.D('div',{id:sign,style:'width:'+A[0]+'px;height:'+A[1]+'px;position:absolute;z-index:2147483647;left:'+Math.floor((U[1]+U[2]-A[0])*Math.random())+'px;top:'+Math.floor((U[0]+U[3]-A[1])*Math.random())+'px;'});
			var close=Q.D('a',{href:'#',style:'width:30px;height:16px;padding-top:3px;text-align:center;display:block;position:absolute;right:0px;color:#FFF;font-size:12px;font-weight:bold;background-color:#555;filter:alpha(opacity=60);opacity:0.6;'});
			close.innerHTML='关闭';
			close.onclick=function(){Q.M(sign);return false;}
			div[F.J](close);
			div[F.J](Q.L(B,C,D));
			Q.I(div);
			var T=null,LX=false,LY=true;
			div.M=function(){
				E();
				var L=parseInt(div.style.left.slice(0,-2))-U[1];var T=parseInt(div.style.top.slice(0,-2))-U[0];
				if ((L-1)<=0){LX=true;}else if((L+1)>=(U[2]-A[0])){LX=false;}
				if((T-1)<=0){LY=true;}else if((T+1)>=(U[3]-A[1]-20)){LY=false;}
				div.style.top=T+(LY?1:-1)+U[0]+"px";
				div.style.left=L+(LX?1:-1)+U[1]+"px";
			}
			T=setInterval(div.M,18);
			div.onmouseover=function(){clearInterval(T);}
	       	div.onmouseout=function(){T=setInterval(div.M,30);}
		},
		D:function(A,B,C,D){
			A=A.split('*');
			var lsign=Q.N();
			var ldiv=Q.D('div',{id:lsign,style:'width:'+A[0]+'px;height:'+A[1]+'px;position:absolute;z-index:2147483647;left:0px;top:130px;'});
			var lclose=Q.D('a',{href:'#',style:'width:30px;height:16px;padding-top:3px;text-align:center;display:block;position:absolute;bottom:0px;right:0px;color:#FFF;font-size:12px;font-weight:bold;background-color:#555;filter:alpha(opacity=60);opacity:0.6;'});
			lclose.innerHTML='关闭';
			ldiv[F.J](lclose);
			ldiv[F.J](Q.L(B,C,D));//创建素材
			Q.I(ldiv);
			var rsign=Q.N();
			var rdiv=Q.D('div',{id:rsign,style:'width:'+A[0]+'px;height:'+A[1]+'px;position:absolute;z-index:2147483647;right:0px;top:130px;'});
			var rclose=Q.D('a',{href:'#',style:'width:30px;height:16px;padding-top:3px;text-align:center;display:block;position:absolute;bottom:0px;left:0px;color:#FFF;font-size:12px;font-weight:bold;background-color:#555;filter:alpha(opacity=60);opacity:0.6;'});
			rclose.innerHTML='关闭';
			rdiv[F.J](rclose);
			rdiv[F.J](Q.L(B,C,D));//创建素材
			Q.I(rdiv);
			lclose.onclick=rclose.onclick=function(){Q.M(lsign);Q.M(rsign);return false;};
		},
		E:function(A,B,C,D,E){
			A=A.split('*');
			var R=Q.L(B,C,D,A[0],A[1]);
			var script=F.D[F.M]('script');
			for(k in script){
				var CODE=script[k].innerHTML;
				if(typeof CODE=='string'){
					if(CODE[F.I](E)>-1){
						if(script[k].parentNode){
							script[k].parentNode.insertBefore(R,script[k]);
						}else{alert('error:5');}
						break;
					}
				}
			}
		}
	};
})();